-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follow up PR for https://github.com/fabric8io/docker-maven-plugin/pull/1373 #1383
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good ! Some minor comments though ;)
return args.get(argString.substring(1)); | ||
} else if (argString.startsWith("${") && argString.endsWith("}") && args.containsKey(argString.substring(2, argString.length() - 1))) { | ||
return args.get(argString.substring(2, argString.length() - 1)); | ||
Pattern argPattern = Pattern.compile("\\$(?:\\{(.*)\\}|(.*))"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pattern argPattern = Pattern.compile("\\$(?:\\{(.*)\\}|(.*))"); | |
Pattern argPattern = Pattern.compile("^\\$(?:\\{(.*)\\}|(.*))$"); |
Align with start and end of the string. Otherwise you would also match bla$ad
or ${foo}bar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But please verify my assumption within the tests, too, please
return args.get(argString.substring(2, argString.length() - 1)); | ||
Pattern argPattern = Pattern.compile("\\$(?:\\{(.*)\\}|(.*))"); | ||
Matcher matcher = argPattern.matcher(argString); | ||
if (matcher.find()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you use matches()
here as find also matches on substrings ? (if you ^
and $
this should make nor difference, but I still think "match" is cleare)
bc9f71a
to
e0279d5
Compare
Use regex in order to resolve ARG value
e0279d5
to
52aed4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ! Looks good ...
Follow up PR for #1373
Use regex in order to resolve ARG value